﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="QuantityCarPosession.ascx.cs" Inherits="CS424_9pts.Manager.Modules.QuantityCarPosession" %>
<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

<div class="section-header">
    <div class="title">
        <img src="../Common/ico-sales.png" alt="Quantity Car Posession Report" />    
    </div>
    <div class="options">
    </div>
</div>

<asp:SqlDataSource  ID="SqlDataSourceQuantityCarPosession" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:CarManagementConnectionString %>"
                    SelectCommand="SELECT     Customers.CustomerID, Count(Car.CarID) AS NumberOfCar
FROM       Car, Customers, Contract
WHERE	   Contract.CarID = Car.CarID 
GROUP BY   Customers.CustomerID" 
    DeleteCommand="DELETE FROM [Maintenance] WHERE [MaintenanceID] = @MaintenanceID" 
    InsertCommand="INSERT INTO [Maintenance] ([ContractID], [Date], [Description], [Subtotal], [TaxID], [Total], [CurrencyID], [Status]) VALUES (@ContractID, @Date, @Description, @Subtotal, @TaxID, @Total, @CurrencyID, @Status)" 
    
    
    
    UpdateCommand="UPDATE [Maintenance] SET [ContractID] = @ContractID, [Date] = @Date, [Description] = @Description, [Subtotal] = @Subtotal, [TaxID] = @TaxID, [Total] = @Total, [CurrencyID] = @CurrencyID, [Status] = @Status WHERE [MaintenanceID] = @MaintenanceID">
    <DeleteParameters>
        <asp:Parameter Name="MaintenanceID" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="ContractID" Type="Int32" />
        <asp:Parameter Name="Date" Type="DateTime" />
        <asp:Parameter Name="Description" Type="String" />
        <asp:Parameter Name="Subtotal" Type="Double" />
        <asp:Parameter Name="TaxID" Type="Int32" />
        <asp:Parameter Name="Total" Type="Double" />
        <asp:Parameter Name="CurrencyID" Type="Int32" />
        <asp:Parameter Name="Status" Type="Int32" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="ContractID" Type="Int32" />
        <asp:Parameter Name="Date" Type="DateTime" />
        <asp:Parameter Name="Description" Type="String" />
        <asp:Parameter Name="Subtotal" Type="Double" />
        <asp:Parameter Name="TaxID" Type="Int32" />
        <asp:Parameter Name="Total" Type="Double" />
        <asp:Parameter Name="CurrencyID" Type="Int32" />
        <asp:Parameter Name="Status" Type="Int32" />
        <asp:Parameter Name="MaintenanceID" Type="Int32" />
    </UpdateParameters>
</asp:SqlDataSource>